package learningThread.api.stopApi;

public class MyThread extends Thread{

    @Override
    public void run() {

        for (int i = 0; i < 500000; i++) {
            if (this.isInterrupted()) {
                System.out.println("已经停止了，即将退出");
                break;
            }
            System.out.println("i="+(i+1));
        }
    }
}
